package com.youxin.logprocess.bean;

/**
 * 保存失败信息
 * @author yingde.cao
 *
 */
public class MessageBean {
	private String hosts;
	private String message;
	
	public MessageBean(){
		
	}
	
	public MessageBean(String hosts,String message)
	{
		this.hosts=hosts;
		this.message=message;
	}
	
	public String getHosts() {
		return hosts;
	}
	public void setHosts(String hosts) {
		this.hosts = hosts;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	
	/**
	 * 主机名相同就表示为同一条失败的信息
	 */
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof MessageBean)
		{
			MessageBean compareBean=(MessageBean)obj;
			return hosts.equals(compareBean.getHosts());
		}
		return false;		
	}
	
	@Override
	public int hashCode() {
		return hosts.hashCode();
	}
	
}
